cd "C:\Users\pgi1\Dropbox\Coal 2021 _ Joe Peter\Bank Regressions\data"


import excel using "deposits_mtrstates.xlsx", clear firstrow  allstring

keep ULTIMATEPARENTID date mtrdepositshare
gen year=year(date(date,"MDY"))
rename ULTIMATEPARENTID ultimateparentid
destring ultimateparentid mtrdepositshare, force replace
keep ultimateparentid  year  mtrdepositshare
keep if year<=2020
bysort ultimateparentid  year: keep if _n==1
tab year
save  mtrdepositshare, replace
